<html>
<head><meta charset="utf-8"><title>Caching `Semantics` · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Caching.20.60Semantics.60.html">Caching `Semantics`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="202543238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Caching%20%60Semantics%60/near/202543238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Caching.20.60Semantics.60.html#202543238">(Jul 01 2020 at 08:32)</a>:</h4>
<p>Should code try to reuse <code>Semantics</code>? There's an <code>ImportsLocator</code> that could easily get an instance but makes a new one instead.</p>



<a name="202543408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Caching%20%60Semantics%60/near/202543408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Caching.20.60Semantics.60.html#202543408">(Jul 01 2020 at 08:35)</a>:</h4>
<p>In generally we should, yeah</p>



<a name="202543424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Caching%20%60Semantics%60/near/202543424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Caching.20.60Semantics.60.html#202543424">(Jul 01 2020 at 08:35)</a>:</h4>
<p>I guess Imports locator should just accept semantics as an argument</p>



<a name="202543434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Caching%20%60Semantics%60/near/202543434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Caching.20.60Semantics.60.html#202543434">(Jul 01 2020 at 08:35)</a>:</h4>
<p>(if it should use it at all)</p>



<a name="202543454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Caching%20%60Semantics%60/near/202543454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Caching.20.60Semantics.60.html#202543454">(Jul 01 2020 at 08:35)</a>:</h4>
<p>Hm, or maybe not so easily (it takes ownership)</p>



<a name="202555702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Caching%20%60Semantics%60/near/202555702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Caching.20.60Semantics.60.html#202555702">(Jul 01 2020 at 11:03)</a>:</h4>
<p>There's quite a bit of code that calls <code>sema.db</code> only to make another <code>Semantics</code> later :D</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>